package com.blog.dao.adminbloggers;

import java.sql.ResultSet;
import java.sql.SQLException;

import com.blog.dao.conn.BaseDao;
import com.blog.dao.conn.ParamSet;
import com.blog.dao.conn.RowDatas;
import com.blog.entity.BloggerEntity;

public class AdminBloggerDao extends BaseDao{

	private RowDatas<BloggerEntity> blogger = new RowDatas<BloggerEntity>() {
		
		@Override
		public BloggerEntity getRowData(ResultSet rs) throws SQLException {
			BloggerEntity be = new BloggerEntity();
			be.setPassword(rs.getString("password"));
			return be;
		}
	};

	/**
	 * 查询用户密码
	 * @param uname
	 * @return
	 */
	public BloggerEntity queryPasswordForLogin(String uname) {
		String sql ="select password from tb_blogger where uname=?";
		return query(sql, new ParamSet(uname), blogger);
	}
}
